import request from '@/utils/request'

export const getShortMessage = (params) => {
  return request({
    url: '/v1/departmentWork/smsg/',
    method: 'get',
    params
  })
}

// 修改短讯通
export const updateShortMessag = (data) => {
  return request({
    url: '/v1/departmentWork/smsg/',
    method: 'put',
    data
  })
}

// 查询登录用户的短讯通记录
export const getMyShorMessage = (params) => {
  return request({
    url: '/v1/departmentWork/smsg/my/',
    method: 'get',
    params
  })
}

// 文件上传
export const fileUpdateMyShortMessage = (data) => {
  return request({
    url: '/v1/departmentWork/smsg/my/fileUpdate/',
    method: 'post',
    data
  })
}

// 手动添加短讯通
export const addMyShortMessage = (data) => {
  return request({
    url: '/v1/departmentWork/smsg/my/',
    method: 'post',
    data
  })
}

// 删除短讯通
export const deleteMyShortMessage = (data) => {
  return request({
    url: '/v1/departmentWork/smsg/my/',
    method: 'delete',
    data: data
  })
}

// 统计短讯通
export const getShortMsgStatistics = (params) => {
  return request({
    url: '/v1/departmentWork/smsg/statistics/',
    method: 'get',
    params
  })
}

// 按月份统计短讯通
export const sShortMsgMonthly = (params) => {
  return request({
    url: '/v1/departmentWork/smsg/statisticsMonthly/',
    method: 'get',
    params,
  })
}